import store from "../store";

export function hasfuncperm(code) {
  const perm_func_codes = store.getters.perm_func_codes
  return perm_func_codes.includes(code)
}

export function hasConstantReadPerm() {
  return hasfuncperm('CLOUDMEDIA_constant_view')
}

export function hasConstantEditPerm() {
  return hasfuncperm('CLOUDMEDIA_constant_edit')
}

export function hasConstantDeletePerm() {
  return hasfuncperm('CLOUDMEDIA_constant_delete')
}

export function hasReviewReadPerm() {
  return hasfuncperm('CLOUDMEDIA_review_view')
}

export function hasReviewEditPerm() {
  return hasfuncperm('CLOUDMEDIA_review_edit')
}

export function hasCpReadPerm() {
  return hasfuncperm('CLOUDMEDIA_cp_view')
}

export function hasCpEditPerm() {
  return hasfuncperm('CLOUDMEDIA_cp_edit')
}

export function hasMaterialReadPerm() {
  return hasfuncperm('CLOUDMEDIA_material_view')
}

export function hasMaterialEditPerm() {
  return hasfuncperm('CLOUDMEDIA_material_edit')
}

export function hasMaterialDeletePerm() {
  return hasfuncperm('CLOUDMEDIA_material_delete')
}
